Monitoring cameras are used in many different applications, both in-doors and outdoors, for monitoring a variety of environments. Images depicting a captured scene may be monitored by, for example, an operator or a guard. In certain situations there may be a need to treat one part of a captured image differently from another part, such as when there is a need to mask part of an image in the interest of personal integrity. This may, for instance, occur when a camera is placed inside a building or inside a bus or a train and the environment outside is to be excluded from the monitoring done by the camera. Another example is when a building with windows is monitored and there is a need to avoid monitoring the inside of the building through the window.
In such instances, a privacy mask may be defined by an operator during set-up of the surveillance equipment. A privacy mask may be static or dynamic. A static privacy mask is usually created by an operator marking the area to be masked on the image in a graphical user interface. The static privacy mask then stays in place until the operator decides to move or remove it. A dynamic privacy mask may change over time. Similar to a dynamic privacy mask, the operator may mark an area in the image where masking is desired. The operator may also input settings determining when the privacy mask should be applied. For instance, the operator could draw a rectangle around a window in the image, and make settings such that if a face is detected within the marked area, that face will be masked out. Such dynamic privacy masks may be beneficial in that as long as the conditions set for the privacy mask are not fulfilled, there is no mask blocking the view, but as soon as, for example, a face detection algorithm, an object detection algorithm or a motion detection algorithm detects that the conditions are fulfilled, the privacy mask is applied. Privacy masks may be applied to the image as an overlay. Some privacy masks take the form of a black or otherwise colored, opaque area. Other privacy masks take the form of blurring, where image data is “smeared” out over the privacy mask area, or pixelization, where the image inside the privacy mask is divided into pixelization blocks and all pixels of a pixelization block are given the same value, such that the image appears blocky inside the privacy mask area. The privacy mask is in many cases a rectangle, or it may be another polygon, or have any other shape more closely following the shape of the area to occlude.
When a camera captures images, they are normally transmitted to a site of use, such as a control center, where they may be viewed and/or stored. They may also be stored in so called “edge storage”, i.e. storage at the camera, either on board the camera, such as on an SD-card, or in connection with the camera, such as on a NAS (network attached storage). Be-fore transmission or edge storage, the images are encoded in order to save bandwidth and storage. Encoding may be performed in many different ways, for example, in accordance with the H.264 standard or other encoding standards. Most, if not all, video encoding is lossy, meaning that information present in the original images is lost during encoding and cannot be regained in decoding. There is a trade-off between reduction of the number of bits required for representing the original images and the resulting image quality. Efforts have been made to develop encoding schemes that make as efficient use of the available bits as possible.
Most video compression standards have originally been developed for use in broadcasting and cinematography, but they are used also in other are-as where requirements are different. One such area is monitoring or surveil-lance, and efforts have been made to optimize encoding for monitoring or surveillance uses. An example of an encoding method which is particularly useful in monitoring applications is disclosed in applicant's EP 3 021 583. Although this encoding method enables significant efficiency improvements, there still remains a desire to further improve encoding. For instance, in images comprising a privacy mask, bits might not always be spent on the most important images or the most important parts of the images. There may also be visual artefacts in the encoded and decoded images.